%% https://raw.githubusercontent.com/ozwin/critical-drone/master/tools/urbi/urbi-sdk-2.7.1-src/doc/document-aux/styles/ldf/lex.sty
%%                                                       -*- LaTeX -*-
%% Language definition of Lex/Flex for listings package
%%

%% Lex
\lstdefinelanguage[]{Lex}%
  {otherkeywords=%
    {\%s,\%\%,\%\{,\%\}
    },%
    morecomment=[n]{/*}{*/},%
    morestring=[b]{"},%
    sensitive=true
  }[keywords]%


%% Lex: Flex

%% Listings does not support ``moreotherkeywords.''
\lstdefinelanguage[Flex]{Lex}%
  {otherkeywords=%
    {\%s,\%\%,\%\{,\%\},
     \%option,\%x
    },%
    morecomment=[n]{/*}{*/},%
    morecomment=[s]{//},%
    morestring=[b]{"},%
    sensitive=true
  }[keywords]%

\lstdefinelanguage{Flex}[Flex]{Lex}{}
